/*
 * ExtentQueryHistory.h
 *
 *  Created on: Dec 16, 2011
 *      Author: Netali
 */

#ifndef LUNTIMESTATISTICS_H_
#define LUNTIMESTATISTICS_H_

#include <stdlib.h>
#include <string>
#include <map>
#include "DeviceData.h"


using namespace std;

class LunTimeStatistics{
/*	double hits;
	double misses;			// misses before the cache partitioning- mainly used for testing
	double new_hits;		// hits after cache partitioning
	double new_misses;		// misses after cache partitioning*/
	double responseTime;

public:
	//fields
	int my_time;					//-1 if its an empty object of type lun time statistics
	double statistics[numStats];	// all extent statistics: each enum stat_name is placed in matching cell
	int lun_id;

	//functions
	LunTimeStatistics (int id,int time);	// constructor
	int getTime();
	double getStatistic(int place);
	void addStatistics(float newStat[numStats]);
	string toString();
/*	double getNewHits() { return new_hits; };
	double getNewMisses() { return new_misses; };
	void setHits(double h) { hits = h; };
	void setMisses(double m) { misses = m; };
	void setNewHits(double hits) { new_hits = hits; };
	void setNewMisses(double misses) { new_misses = misses; };
	*/double getResponseTime() {return responseTime; };
	void calcResponseTime(double ssdRead, double ssdKb, double fcRead, double fcKb, double sataRead, double sataKb, DeviceData* ssd, DeviceData* fc, DeviceData* sata, int priorityGroup);
	void calcResponseTimeGD(double ssdRead, double ssdKb, double fcRead, double fcKb, double sataRead, double sataKb, DeviceData* ssd, DeviceData* fc, DeviceData* sata, double ssdU[], double fcU[], double sataU[], int priorityGroup);
	void startOver();
};
#endif	/* LUNTIMESTATISTICS_H_ */
